<template>
	<view>
		<!-- 列表 -->
		<z-paging ref="paging" v-model="dataList" :hide-no-more-inside="true" 
		refresher-complete-duration="800" local-paging-loading-time='1000'
		loading-more-no-more-text="我也是有底线的！" @query="queryList">
		<zEmpty slot="empty" title="暂无数据~"></zEmpty>
		<zFeedCard :activeid="activeid" :dataList="dataList"  @showSwiper='showSwiper'></zFeedCard>
		</z-paging>
		<!-- end -->
	</view>
</template>

<script>
	import zFeedCard from "@/components/z-feedBack-card/z-feedBack-card.vue"
	import zEmpty from "@/components/z-empty/index.vue"
	import { toast } from '@/uni_modules/uv-ui-tools/libs/function/index.js'
	import {
		pageFeedBack
	} from '@/utils/api.js'
	
	export default {
		components: {
			zFeedCard,
			zEmpty
		},
		data() {
			return {
				activeid: 5,
				dataList: [],

			}
		},
		onShow() {
			
		},
		mounted() {},
		methods: {
			//图片预览
			showSwiper(list,index){  
				uni.previewImage({
					current: index, //预览图片的下标
					urls: JSON.parse(decodeURIComponent(list)) //预览图片的地址，必须要数组形式
				}) 
			},
			// 分页加载
			queryList(pageNum, pageSize) {
			pageFeedBack({
				"current": pageNum,
				"size": pageSize,
				"type": 20,
			}).then(res => {
				if (res.code == "200" && res.result.records) {
					this.$refs.paging.complete(res.result.records); 
				} else {
					this.$refs.paging.complete(false);
				}
			})

			},
			getActiveLabel(index) {
				this.activeid = index;
				this.$forceUpdate()
			}
		}
	}
</script>

<style lang="scss">
	page{
		 background-color: #F8F8F8;
	}
 .z-paging-content{  
	 top: 0 !important;
 }
</style>